import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/salesGiftList/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/salesGiftList/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/salesGiftList/addOrSave',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/salesGiftList/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/salesGiftList/import',
    method: 'post',
    data
  })
}

export function enableOrDisable(data) {
  const obj = {
    url: 'api/salesGiftList/enableOrDisable',
    method: 'post',
    data
  }
  return request(obj)
}
export function passOrReject(data) {
  const obj = {
    url: 'api/salesGiftList/enableOrDisable',
    method: 'post',
    data
  }
  return request(obj)
}

export function giftRecord(data) {
  const obj = {
    url: '/api/salesGiftList/giftRecord',
    method: 'get',
    params: data
  }
  return request(obj)
}

export function addSalesOrder(ids) {
  return request({
    url: 'api/salesGiftList/addSalesOrder',
    method: 'post',
    data: ids
  })
}

export default { add, edit, exportDe, importDe, del, enableOrDisable,passOrReject, giftRecord }
